package com.wanrue.tcc.enums;

/**
 * tcc 执行状态
 * Created by wenjie on 11/08/18.
 */
public enum Status {

    /**
     * 尝试中
     */
    TRYING(1),
    /**
     * 确认中
     */
    CONFIRMING(2),

    /**
     * 取消中
     */
    CANCELLING(3);

    private int id;

    Status(int id) {
        this.id = id;
    }

    public int value() {
        return id;
    }

    public static Status valueOf(int id) {
        switch (id) {
            case 1:
                return TRYING;
            case 2:
                return CONFIRMING;
            case 3:
                return CANCELLING;
            default:
                return null;
        }
    }
}
